<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title></title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
  
    <jsp:useBean id="formElement" class="chapter6.FormElementsGenerate" scope="session"/>
    <jsp:setProperty name="formElement" property="init" value="init"/>
     
    <form>
    	<!--自动生成文本框 -->
    	<c:set var="texts" value="${sessionScope.formElement.texts}" scope="page" />
    	
    	
    	<c:if test="${empty pageScope.texts}">
    		EMpty1!
    	</c:if>
    	
     	<!--自动生成本文框 -->	
    	<c:forEach var="item" items="${pageScope.texts}">
    		${item.label}  <input type="text" name="${item.value}"><br/>
    	</c:forEach> 
    	
    	
    	
    	
    	<!--自动生成复选按钮 -->
    	<c:set var="newstypes" scope="page" value="${sessionScope.formElement.checkboxes}"/>
    	<c:forEach var="item" items="${pageScope.newstypes}">
    		<input type="checkbox" name="newstypes" value="${item.value }">${item.label}<br/>
    	</c:forEach> 
    	
    	<!--自动生成单选框-->
    	<c:set var="radios" scope="page" value="${sessionScope.formElement.radios}"/>
    	<select>
    		<c:forEach var="item" items="${pageScope.radios}">
    			<option value="${item.value }">${item.label}</option>
    		</c:forEach>
    	</select>
     
    </form>
   
    
  </body>
</html>
